In manufacturing a three-dimensional semiconductor memory which is one of semiconductor devices, for example, an insulator is buried in a groove dividing a stacked body, and a hole is formed in a part of the groove using a mask.